\version "2.14.0"  % necessary for upgrading to future LilyPond versions.
%{

Lumen Christi Missal Hymn Template: Melody Only
by Aristotle A. Esguerra
Version 0.1.2-20121105
Sample Hymn Tune: Old Hundredth 88.88
Sample Hymn Text: All People that on Earth Do Dwell

%}
\include "include.ly"
%header%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% GLOBAL DEFAULTS

  #(set-default-paper-size "half letter")
  #(set-global-staff-size %staffsize:16%)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% LYRICS
  %% Maximum number of verses: 6
  %% Additional verses should go underneath the notation
  %% or onto a facing page using TeX

verseOne = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseOne%
  \set stanza = \markup\concat{"%verseOneNote% %verseOneNumber:1.% "}
  %verseTwo?%:\set stanza = ""%
  %verseOne%
  }
}
verseTwo = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseTwo%
  \set stanza = \markup\concat{"%verseTwoNote% %verseTwoNumber:2.% "}
  %verseTwo%
  }
}
verseThree = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseThree%
  \set stanza = \markup\concat{"%verseThreeNote% %verseThreeNumber:3.% "}
  %verseThree%
  }
}
verseFour = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseFour%
  \set stanza = \markup\concat{"%verseFourNote% %verseFourNumber:4.% "}
  %verseFour%
  }
}
verseFive = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseFive%
  \set stanza = \markup\concat{"%verseFiveNote% %verseFiveNumber:5.% "}
  %verseFive%
  }
}
verseSix = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseSix%
  \set stanza = \markup\concat{"%verseSixNote% %verseSixNumber:6.% "}
  %verseSix%
  }
}
verseSeven = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseSeven%
  \set stanza = \markup\concat{"%verseSevenNote% %verseSevenNumber:7.% "}
  %verseSeven%
  }
}
verseEight = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseEight%
  \set stanza = \markup\concat{"%verseEightNote% %verseEightNumber:8.% "}
  %verseEight%
  }
}
verseNine = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseNine%
  \set stanza = \markup\concat{"%verseNineNote% %verseNineNumber:9.% "}
  %verseNine%
  }
}
verseTen = {
  \lyricmode {
  %ignoreMelismata?\set ignoreMelismata = ##t%
  %refrainBeforeVerseTen%
  \set stanza = \markup\concat{"%verseTenNote% %verseTenNumber:10.% "}
  %verseTen%
  }
}

%%%% VERSE LAYOUT (ALTER FOR # OF VERSES) %%%%%%%%%

verseLayout = {
<<
      \new Lyrics = vI %{lineAfterVerseOne?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseOne
      \new Lyrics = vII %{lineAfterVerseTwo?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseTwo
      \new Lyrics = vIII %{lineAfterVerseThree?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseThree
      \new Lyrics = vIV %{lineAfterVerseFour?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseFour
      \new Lyrics = vV %{lineAfterVerseFive?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseFive
      \new Lyrics = vVI %{lineAfterVerseSix?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseSix
      \new Lyrics = vVII %{lineAfterVerseSeven?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseSeven
      \new Lyrics = vVIII %{lineAfterVerseEight?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseEight
      \new Lyrics = vIX %{lineAfterVerseNine?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseNine
      \new Lyrics = vX %{lineAfterVerseTen?\with {\override LyricText #'after-line-breaking = #draw-on-first-syl }%} \lyricsto sop \verseTen
>>
}

%%%%%%%%%% SATB %%%%%%%%%%

 %%% GUITAR CHORDS
  %% - Included here as a proof-of-concept sort of thing
  %% - This would be an input or textarea field on the Web app

  hymnHarmonies = \chordmode {
  }

 %%% SOPRANO (assumed to be the chant melody)
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aSop = \transpose %key:c% %transposekey:c% {
    \relative c' {
      \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
      \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT
      %\once \override Score.KeySignature #'break-align-anchor = #1
      \once \override Score.RehearsalMark #'extra-offset = #'(0.5 . -0.25)
      \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
      \once \override Score.RehearsalMark #'padding = #1.9
      %\mark \markup\smaller\smaller\italic"%{annotation?Mode %}%annotation%"
      %{suppressTimeSignature?
        \override Staff.TimeSignature #'stencil = ##f
        \cadenzaOn
      %}
      %sop%
    }
  }

 %%% ALTO
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aAlt = \transpose %key:c% %transposekey:c% {
    \relative c' {
      %{suppressTimeSignature?
        \override Staff.TimeSignature #'stencil = ##f
        \cadenzaOn
      %}
      %alt%
    }
  }

 %%% TENOR
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aTen = \transpose %key:c% %transposekey:c% {
    \relative c' {
      %{suppressTimeSignature?
        \override Staff.TimeSignature #'stencil = ##f
        \cadenzaOn
      %}
      %ten%
    }
  }

 %%% BASS
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aBas = \transpose %key:c% %transposekey:c% {
    \relative c' {
      %{suppressTimeSignature?
        \override Staff.TimeSignature #'stencil = ##f
        \cadenzaOn
      %}
      %bas%
      
    }
  }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% LAYOUT PREP
  %% Below specs assume a pure LilyPond implementation
  %% Customize for integration into TeX

lyricSize = #'%lyricsize:1.5%
lyricMinDistance = #%lyricMinDistance:3%
global = \transpose %key:c% %transposekey:c% {
  \autoBeamOff

  %% Centers guitar chords over noteheads
  #(define (centerCN grob)
     (ly:stencil-aligned-to (ly:text-interface::print grob) X CENTER )) 
  \key %key:c% \major
}

trebleMusic = <<
  %{separateVoices?%:\global \partcombine {\partcombineAutomatic \aSop} \aAlt
   \new Voice = "sop" \with {
    \remove "Breathing_sign_engraver"
    \remove "Dots_engraver"
    \remove "Dynamic_engraver" 
    \remove "Mark_engraver"
    \remove "Rest_engraver"
    \remove "Script_engraver"
    \remove "Text_engraver"
    \override Stem.direction = #1
    \override NoteColumn.ignore-collision = ##t
    \override Stem.length = #0
    \override Beam.positions = #'(1 . 1)
    \override Accidental.stencil = ##f
    \override Beam.stencil = ##f
    \override Dots.stencil = ##f
    \override Flag.stencil = ##f
    \override Rest.stencil = ##f
    \override Slur.stencil = ##f
    \override Stem.stencil = ##f
    \override Tie.stencil = ##f
    \override NoteHead.transparent = ##t
    \override TabNoteHead.transparent = ##t
    \override NoteHead.X-offset = #0
    squashedPosition = #0
  } { \global \aSop }
  %}
  %separateVoices?\new Voice = "sop" << \voiceOne \global \aSop >>%
  %separateVoices?\new Voice = "alt" << \voiceTwo \global \aAlt >>%
>>

bassMusic = <<
  %separateVoices?%:\global \partcombine {\partcombineAutomatic \aTen} \aBas%
  %separateVoices?\new Voice = "ten" << \voiceOne \global \aTen >>%
  %separateVoices?\new Voice = "bas" << \voiceTwo \global \aBas >>%
>>

  %% Below specs assume a pure LilyPond implementation
  %% Customize for integration into TeX


\paper {
  indent = 0\in
  annotate-spacing = ##f
  before-title-space = 0\in
  ragged-bottom = ##t
  ragged-last-bottom = ##t

  %% Between-System Spacing
  system-system-spacing =
    #'((basic-distance . 0)
       (minimum-distance . 0)
       (padding . 3)
       (stretchability . 0))
  markup-system-spacing =
    #'((stretchability . 0))
  paper-height = %height%\in
  line-width = %width%\in %% presets can be specified in the web form
                      %% note that this doesn't include the width
                      %% of the system brace.
  paper-width = %width%\in
  left-margin = 0\in
  right-margin = 0\in
  top-margin = 0\in
  bottom-margin = 0\in
  myStaffSize = #%staffsize:16%   %% Same as #(set-global-staff size)

  %% FONT SPECIFICATIONS FOR LYRICS
  %% - Like in the Gregorio app, a dropdown can be created for the user
  %%   to specify the desired lyric font.
  %% - Users should be allowed to choose only the first font; the second 
  %%   and third fonts are for 'sans' and 'fixed-width' font overrides.
  %% - Alternatively, you can pass the same font into all three fields.

  #(define fonts
    (make-pango-font-tree "Garamond Premier Pro"
                          "Arial"
                          "Courier"
                           (/ myStaffSize 20)))

  %% eliminates headers and footers; may not be necessary in a
  %% TeX integration
  oddHeaderMarkup = \markup \null
  evenHeaderMarkup = \markup \null
  oddFooterMarkup = ""
  evenFooterMarkup = ""
  ragged-last = ##%raggedlast:f%
}
paddingOverride = \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing = #'((basic-distance . 0)
  (minimum-distance . 5.5)
  (padding . %lyricPadding:1%)
  (stretchability . 0))
\include "layout-hymn-%layout:satb%%suppressStems?-suppressStems%.ly"